<?php
    $acl = $data['acl'];
    $user = $data['user']->attributes;
?>
<div class="block">

    <div class="block_head">
        <div class="bheadl"></div>
        <div class="bheadr"></div>
        <h2>Phân quyền cho user: <strong style="color: red;"><?php echo $user['email']; ?></strong></h2>
    </div>

    <div class="block_content">
        <form action="" method="post">            
            <?php
                foreach($acl as $controller) {
                    $actions = explode(',', $controller['actions']);
            ?>
            <p>
                <label><?php echo $controller['name']; ?>:</label><br />
                <span style="font-size: 11px; color: gray;"><?php echo $controller['description']; ?></span><br />
                <?php
                    foreach($actions as $act) {
                ?>    
                <input type="checkbox" name="<?php echo $controller['controller']; ?>[]" class="checkbox" id="<?php echo $controller['controller'] . '-' . $act; ?>" value="<?php echo $act; ?>" /> 
                <label style="font-weight: normal;" for="<?php echo $controller['controller'] . '-' . $act; ?>"><?php echo $act; ?></label> 
                <?php
                    }
                ?>
            </p>
            <?php
                }
            ?>

            <hr />

            <p>
                <input type="submit" class="submit small" value="Submit" />
            </p>
        </form>


    </div>		<!-- .block_content ends -->

    <div class="bendl"></div>
    <div class="bendr"></div>

</div>